package com.startit.validation;

import com.startit.csv.CSVField.ValidationType;

public class MaxLengthValidation implements IValidation {
	public static final ValidationType name = ValidationType.MAXLENGTH;
	private int maxLength;

	public MaxLengthValidation(int maxLength) {
		super();
		this.maxLength = maxLength;
	}

	public boolean valid(String v) {
		return v==null || v.trim().length()<=maxLength;
	}

}
